<!DOCTYPE html>
<html lang="zh">

<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title>國家/城市</title>
	<meta name="description" content="Kenny is a Dashboard & Admin Site Responsive Template by hencework." />
	<meta name="keywords" content="admin, admin dashboard, admin template, cms, crm, Kenny Admin, kennyadmin, premium admin templates, responsive admin, sass, panel, software, ui, visualization, web app, application" />
	<meta name="author" content="hencework" />

	<!-- Favicon -->
	<link rel="shortcut icon" href="/favicon.ico">
	<link rel="icon" href="/favicon.ico" type="image/x-icon">
 
	<!-- Data table CSS -->
	<link href="__STATIC__/admin/dist/datatables/media/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="__STATIC__/admin/dist/css/Price.css" />
	<!-- Custom CSS -->
	<link href="__STATIC__/admin/dist/css/style.css" rel="stylesheet" type="text/css">
	<!-- switchery CSS -->
	<link href="__STATIC__/admin/dist/switchery/dist/switchery.min.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" href="__STATIC__/admin/dist/css/modify-up.css" />
	<style>
		.switchery {
			margin-top: 0;
		}
		.addFrom{
			padding: 10px 0 0px 45px
		}
	</style>
</head>

<body>
	<!--添加内容-->
	<div class="addFrom">
		<form action="<?php $add='/admin/area/addArea'; $edit='/admin/area/editArea?id='.$list['data_id']; echo empty($list)?$add:$edit;?>" method="post" id="form">

			<input type="hidden" id="father" name="parent" value="{if(!$list)}{$parent}{else}{$list.parent}{/if}" />

			<div id="divDtls">
				<div class="form-content">
					<div class="header-title btn-primary text-center">
						<h5><?php echo empty($list)?"新增内容":"修改内容"?></h5>
					</div>
					<div class="card-views">
						<div class="row form-txt">
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">名称： </label>
									<div class="col-sm-9"><input type="text" name="name" class="ft-1 form-control" value='{$list.name}' /></div>
								</div>
							</div>

							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">简称： </label>
									<div class="col-sm-9"><input type="text" name="sname" class="ft-1 form-control" value='{$list.sname}'/></div>
									<!--提示-->
									<div class="col-xs-12">
										<div class="row">
											<div class="col-md-9 col-md-offset-3 "style="color: #333;">
												 ( 如：BKK,BKI,HK等等)
											</div>
										</div>
									</div>
								</div>
							</div>

							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">英文名称： </label>
									<div class="col-sm-9"><input type="text" name="en_name" class="ft-1 form-control" value='{$list.en_name}' /></div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">拼音简称 ： </label>
									<div class="col-sm-9"><input type="text" name="spinyin" class="ft-1 form-control" value='{$list.spinyin}' /></div>
									<!--提示-->
									<div class="col-xs-12">
										<div class="row">
											<div class="col-md-9 col-md-offset-3 " style="color: #333;">
												( 如：深圳>SZ)
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">是否锁定： </label>
									<div class="col-sm-9 col-xs-12">
											<input type="checkbox" name="is_lock" value="1" {if($list.is_lock==2)} checked="" {/if} class="js-switch" data-color="#566FC9"  />
									</div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">拼音：</label>
									<div class="col-sm-9"><input type="text" name="pinyin" class="form-control" value='{$list.pinyin}' placeholder="" /></div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">是否国家： </label>
									<div class="col-sm-9 col-xs-12">
											<input type="checkbox" name="is_country" value="1" {if($list.is_country==1)} checked="" {/if} class="js-switch" data-color="#566FC9"  />
									</div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">排序号：</label>
									<div class="col-sm-9"><input type="text" class="form-control" name="sort" value='<?php echo $list['sort'] ?>' /></div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">是否显示： </label>
									<div class="col-sm-9 col-xs-12">
											<input type="checkbox" name="is_hidden" value="1" {if($list.is_hidden==1)} checked="" {/if} class="js-switch" data-color="#566FC9"  />
									</div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">是否热门： </label>
									<div class="col-sm-9 col-xs-12">
											<input type="checkbox" name="is_hot" value="1" {if($list.is_hot==1)} checked="" {/if} class="js-switch" data-color="#566FC9"  />
									</div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">是否推荐国家： </label>
									<div class="col-sm-9 col-xs-12">
										<input type="checkbox" name="is_recommend" value="1" {if($list.is_recommend=='yes')} checked="" {/if} class="js-switch" data-color="#566FC9"  />
									</div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">备注说明：</label>
									<div class="col-sm-9">
										<textarea name="remark" class="form-control remarks col-sm-12" rows="3">{$list.remark}</textarea>
									</div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">地区类型：</label>
									<div class="col-sm-3 col-xs-12">
										<select class="form-control" name="areaClass">
											<option value ="0">请选择</option>
											<?php foreach($areaClass as $k => $v){ ?>
												<option value ="{$v['ty_id']}" <?php echo ($list['type_id']==$v['ty_id'] ? "selected" : "") ?>>{$v["ty_name"]}</option>
											<?php } ?>
										</select>
									</div>
								</div>
							</div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">是否海外城市： </label>
									<div class="col-sm-9 col-xs-12">
										<input type="checkbox" name="is_overseas" value="1" {if($list.is_overseas==1)} checked="" {/if} class="js-switch" data-color="#566FC9"  />海外城市
									</div>
								</div>
							</div>
							<div class="interlacing-box"></div>
							<div class="col-sm-6 col-xs-12 sjj">
								<div class="form-group">
									<label class="control-label col-sm-3 lables">操作：</label>
									<div class="col-sm-9">
										<button type="button" id="suc_hold" class="btn btn-success mr-10"><?php echo empty($list)?"保存新增":"保存修改"?></button>
										&nbsp;
										<a href="javascript:void(0)" id="go-back"><input type="button" value="返回列表" id="btnSvCancel" class="SrvButton btn btn-default"></a></div>
								</div>
							</div>
						</div>

					</div>
				</div>
			</div>

		</form>
	</div>

	<!--/添加内容-->
	<!-- jQuery -->
	<script src="__STATIC__/admin/dist/js/jquery.min.js"></script>

	<!-- Bootstrap Core JavaScript -->
	<script src="__STATIC__/admin/dist/js/bootstrap.min.js"></script>
	<script src="__STATIC__/admin/dist/js/dataTab.js"></script>
	<!-- Data table JavaScript -->
	<script src="__STATIC__/admin/dist/datatables/media/js/jquery.dataTables.min.js"></script>
	<script src="__STATIC__/admin/dist/js/dataTables-data.js"></script>
	<!-- Slimscroll JavaScript -->
	<script src="__STATIC__/admin/dist/js/jquery.slimscroll.js"></script>
	<!-- Fancy Dropdown JS -->
	<script src="__STATIC__/admin/dist/js/dropdown-bootstrap-extended.js"></script>
	<!-- Init JavaScript -->
	<script src="__STATIC__/admin/dist/js/init.js"></script>
	<!-- Switchery JavaScript -->
	<script src="__STATIC__/admin/dist/switchery/dist/switchery.min.js"></script>
	<!-- Slimscroll JavaScript -->
	<script src="__STATIC__/admin/dist/switchery/dist/jquery.slimscroll.js"></script>

	<!-- Fancy Dropdown JS -->
	<script src="__STATIC__/admin/dist/switchery/dist/dropdown-bootstrap-extended.js"></script>
	
	<!-- Bootstrap Select JavaScript -->
	<script src="__STATIC__/admin/dist/switchery/dist/bootstrap-select.min.js"></script>
	
	<!-- Bootstrap Touchspin JavaScript -->
	<script src="__STATIC__/admin/dist/switchery/dist/jquery.bootstrap-touchspin.min.js"></script>
	
	<!-- Multiselect JavaScript -->
	<script src="__STATIC__/admin/dist/switchery/dist/jquery.multi-select.js"></script>
	<!-- Bootstrap Switch JavaScript -->
	<script src="__STATIC__/admin/dist/switchery/dist/bootstrap-switch.min.js"></script>
	<!-- Switchery JavaScript -->
	<script src="__STATIC__/admin/dist/switchery/dist/switchery.min.js"></script>
	<!-- Select2 JavaScript -->
	<script src="__STATIC__/admin/dist/js/select2.full.min.js"></script>
	<!-- Form Advance Init JavaScript -->
	<script src="__STATIC__/admin/dist/js/form-advance-data.js"></script>

	{include file='admin@common/alert'/}

</body>

</html>
	

<script type="text/javascript">
	$(function(){

		// 点击保存
		$("#suc_hold").click(function(){
			$(".maksa").css("width",$(window).width());
			$(".maksa").css("height",$(document).height());
			$(".maksa").show();
			$(".popup").css("left",($(window).width()-$(".popup").width())/2);
			$(".popup").css("top",($(window).height()-$(".popup").height())/2);
			$("#popup_2").show();  //简单的触发弹窗事件如果要触发自己想要的弹窗 请修改选择器为ID选择器 两种弹框
			$('.popup_cont').html('是否提交？');
		})

		// 带取消按钮的点击确定
		$('.popup_butA').click(function(e){
			e.preventDefault();//阻止form表单提交
			var data = $("#form").serialize();
			var url = $("#form").attr("action");
			var parent = $("#father").val();
			$.ajax({
				type:"POST",
				url :url,
				data:data,
				success:function(data){
					if (data.code == 1) {
						window.location.href = '/admin/area/area?parent='+parent+'&page=';
						return;
					}
					if(data.code==2) {
						window.location.href = '/admin/area/area?parent='+parent+'&page='+data.page;
						return;
					}
					var info = '';
					if(data.name != null){
						info+= data.name+'<br>';
					}
					if(data.sort != null){
						info+= data.sort+'<br>';
					}

					if(data.msg != null){
						info+= data.msg+'<br>';
					}

					// 调用弹窗并渲染信息
					vinfo(info);
				}
			})

		})

		$("#go-back").click(function(){
			var parent = $("#father").val();
			window.location.href = '/admin/area/area?parent='+parent+'&page=';
		})
		
		//提示信息弹窗
		function vinfo(data){
			$(".maksa").css("width",$(window).width());
			$(".maksa").css("height",$(document).height());
			$(".maksa").show();
			$(".popup").css("left",($(window).width()-$(".popup").width())/2);
			$(".popup").css("top",($(window).height()-$(".popup").height())/2);
			$("#popup_1").show();  //简单的触发弹窗事件如果要触发自己想要的弹窗 请修改选择器为ID选择器 两种弹框
			$('.popup_cont').html(data);
		}

	})
</script>